#pragma once

#include <AVUIFrameworkTemplate.h>

namespace AVUI {
class ItemsPresenter;

/// <summary>Specifies the panel that the <see cref="T:System.Windows.Controls.ItemsPresenter" /> creates for the layout of the items of an <see cref="T:System.Windows.Controls.ItemsControl" />.</summary>
class ItemsPanelTemplate : public FrameworkTemplate
{
public:
    DECLARE_ELEMENT(ItemsPanelTemplate, FrameworkTemplate);

#pragma region Public Methods

    /// <summary>Initializes an instance of the <see cref="T:System.Windows.Controls.ItemsPanelTemplate" /> class.</summary>
    ItemsPanelTemplate() { }

    /// <summary>Initializes an instance of the <see cref="T:System.Windows.Controls.ItemsPanelTemplate" /> class with the specified template.</summary>
    /// <param name="root">The <see cref="T:System.Windows.FrameworkElementFactory" /> object that represents the template.</param>
    ItemsPanelTemplate(FrameworkElementFactory* pRoot) { set_VisualTree(pRoot); }

#pragma endregion Public Methods

protected:

#pragma region Protected Methods

    /// <summary>Checks that the templated parent is a non-null <see cref="T:System.Windows.Controls.ItemsPresenter" /> object.</summary>
    /// <returns />
    /// <param name="templatedParent">The element this template is applied to. This must be an <see cref="T:System.Windows.Controls.ItemsPresenter" /> object.</param>
    /// <exception cref="T:System.ArgumentNullException">
    /// <paramref name="templatedParent" /> is null.</exception>
    /// <exception cref="T:System.ArgumentException">
    /// <paramref name="templatedParent" /> is not an <see cref="T:System.Windows.Controls.ItemsPresenter" />.</exception>
    virtual void ValidateTemplatedParent(FrameworkElement* pTemplatedParent) AVUI_OVERRIDE;

#pragma endregion Protected Methods

public:

#pragma region Internal Methods

    virtual void ProcessTemplateBeforeSeal() AVUI_OVERRIDE;
    virtual void SetTargetTypeInternal(const Type* pTargetType) AVUI_OVERRIDE;

#pragma endregion Internal Methods

#pragma region Internal Properties

    static const Type* get_DefaultTargetType() { return &GET_TYPE(ItemsPresenter); }
    virtual const Type* get_TargetTypeInternal() AVUI_OVERRIDE { return get_DefaultTargetType(); }

#pragma endregion Internal Properties

};



}; // namespace AVUI
